package cn.com.infcn.entities;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * 字段配置
 * @author Ansj
 *
 */
@Entity
@Table(name = "mss_table")
public class MssTable {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	private String name;

	private Boolean strict; //是否严格控制

	@Column(name = "auto_index")
	private Boolean index; //是否进行索引

	private Integer number_of_tables; //分表数, 默认10

	private Integer number_of_shards; //分片数, 默认5

	private Integer number_of_replicas; //备份数 默认1

	private Date create_time;

	private Date update_time;

	private Integer records; // 记录数, 默认0
	
	private Integer indexs;  // 索引数, 默认0
	
	private String alias;
	
	@Transient
	private List<MssField> fields = new ArrayList<>();


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getStrict() {
		return strict;
	}

	public void setStrict(Boolean strict) {
		this.strict = strict;
	}

	public List<MssField> getFields() {
		return fields;
	}

	public void setFields(List<MssField> fields) {
		this.fields = fields;
	}


	public Boolean getIndex() {
		return index;
	}

	public void setIndex(Boolean index) {
		this.index = index;
	}

	public Integer getNumber_of_shards() {
		return number_of_shards;
	}

	public void setNumber_of_shards(Integer number_of_shards) {
		this.number_of_shards = number_of_shards;
	}

	public Integer getNumber_of_replicas() {
		return number_of_replicas;
	}

	public void setNumber_of_replicas(Integer number_of_replicas) {
		this.number_of_replicas = number_of_replicas;
	}

	public Date getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}

    public Date getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }

	public Integer getRecords() {
		return records;
	}

	public void setRecords(Integer records) {
		this.records = records;
	}

	public Integer getIndexs() {
		return indexs;
	}

	public void setIndexs(Integer indexs) {
		this.indexs = indexs;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

    public Integer getNumber_of_tables() {
        return number_of_tables;
    }

    public void setNumber_of_tables(Integer number_of_tables) {
        this.number_of_tables = number_of_tables;
    }
}
